/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidades;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author nivri
 */
@Entity
@Table(name = "diaslibres_col")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "DiaslibresCol.findAll", query = "SELECT d FROM DiaslibresCol d"),
    @NamedQuery(name = "DiaslibresCol.findById", query = "SELECT d FROM DiaslibresCol d WHERE d.id = :id"),
    @NamedQuery(name = "DiaslibresCol.findByFecha", query = "SELECT d FROM DiaslibresCol d WHERE d.fecha = :fecha")})
public class DiaslibresCol implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 36)
    @Column(name = "id")
    private String id;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecha")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecha;
    @JoinColumn(name = "fk_col", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Colaboradores fkCol;

    public DiaslibresCol() {
    }

    public DiaslibresCol(String id) {
        this.id = id;
    }

    public DiaslibresCol(String id, Date fecha) {
        this.id = id;
        this.fecha = fecha;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public Colaboradores getFkCol() {
        return fkCol;
    }

    public void setFkCol(Colaboradores fkCol) {
        this.fkCol = fkCol;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DiaslibresCol)) {
            return false;
        }
        DiaslibresCol other = (DiaslibresCol) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.DiaslibresCol[ id=" + id + " ]";
    }
    
}
